/////////////////////////////////////////////////////////////////////////////
/// @file BiTree_TestSuite.hpp
/// @ingroup
///
/// File containing the implementation for testing BiTree class implementation
/// Unit under test: BiTree.hpp
///
/// @see BiTree_TestSuite.cpp
///
/// @if REVISION_HISTORY_INCLUDED
/// @par Edit History
/// @li [0]   zhalat 1-Jul-2014 Initial revision of file.
/// @endif
///
/// @par &copy;  2014 HalSoft
/////////////////////////////////////////////////////////////////////////////

#ifndef _BITREE_TESTSUITE
#define _BITREE_TESTSUITE

// SYSTEM INCLUDES
#include <cppunit/ui/text/TestRunner.h>
#include <cppunit/CompilerOutputter.h>
#include <cppunit/TestFixture.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/TestSuite.h>
#include <cppunit/Test.h>
#include <cppunit/TestResult.h>
#include <cppunit/TestResultCollector.h>
#include <cppunit/TestCaller.h>
#include <cppunit/TestAssert.h>
#include <cppunit/TestResultCollector.h>
#include <cppunit/TestRunner.h>
#include <cppunit/BriefTestProgressListener.h>
#include <cppunit/CompilerOutputter.h>
#include <cppunit/XmlOutputter.h>
#include <iostream>
#include <string>
#include <fstream>

// C++ PROJECT INCLUDES
#include "BiTree.hpp"
#include "BiTree_TestSuite_helper.hpp"

using namespace tree;

//forward reference
class userclass;

class BiTree_TestSuite: public CppUnit::TestFixture
{
    private:
        //embedded type
        BiTree<int> *emb_bt;
        //user defined type
        BiTree<userclass> *usr_bt;

    public:
        void setUp()
        {
            emb_bt = new BiTree<int>();
            usr_bt = new BiTree<userclass>();
        }

        BiTree_TestSuite(){};
        ~BiTree_TestSuite(){};

        static CppUnit::Test* suite();

        //tests embedded type trees
        void test_constructor1_emb(void);
        void test_ins_left_emb(void);
        void test_ins_right_emb(void);
        void test_load_from_file_emb(void);
        void test_rem_left_emb(void);
        void test_rem_right_emb(void);
        void test_if_child_left_null_emb(void);
        void test_if_child_right_null_emb(void);
        void test_tree_high_emb(void);

        //tests user-defined type trees
        void test_constructor1_usr(void);
        void test_ins_left_usr(void);
        void test_ins_right_usr(void);
        void test_load_from_file_usr(void);
        void test_rem_left_usr(void);
        void test_rem_right_usr(void);
        void test_if_child_left_null_usr(void);
        void test_if_child_right_null_usr(void);

        void tearDown()
        {
            delete emb_bt;
            delete usr_bt;
        }
};

#endif//_BITREE_TESTSUITE
